package com.inca.shop.order.fegin.fallback.factory;

import com.inca.shop.bean.User;
import com.inca.shop.order.fegin.UserService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserServiceFallBackFactory implements FallbackFactory<UserService> {
    @Override
    public UserService create(Throwable throwable) {
       return new UserService() {
           @Override
           public User getUser(Long uid) {
               User user = new User();
               user.setId(-1L);
               return user;
           }
       };
    }
}
